<style tyle="text/css">
  .quick-btn {
    padding-top: 8px;
		color: #428bca;
  }
	.red {
		color: #f00
	}
	.overhidden {
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
	}
	.height77 {
		height: 77px;
	}
	.pad0 {
    padding: 0px;
	}
	.content_style {
		padding: 8px 10px;
    border-right: 1px solid #eaeff0;
	}
	.mt10 {
		margin-top: 10px;
	}
	.top_pic {
		float: left;
		margin-top: -5px;
		margin-right: 10px;
	}
	.mt1 {
		margin-top: 1px;
	}
</style>
<div class="col-lg-12 mt20">
  <div class="panel">
    <div class="panel-body">
      <div class="row col-lg-12">
        <label class="form-control-static col-lg-2" style="width: 13%; text-align: right">购买时间范围：</label>
        <div class="col-lg-2-4">
          <div class="input-group" ng-click="dateOpen($event, datestart)">
            <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="datestart.lable" 
            is-open="datestart.opened" placeholder="开始时间" ng-required="true" 
            close-text="关闭" current-text="今天" clear-text="清除" readonly/>
            <span class="input-group-btn">
              <button type="button" class="btn btn-default">
                <i class="glyphicon glyphicon-calendar"></i>
              </button>
            </span>
          </div>
        </div>
        <div class="col-lg-2-4">
          <div class="input-group" ng-click="dateOpen($event, dateend)">
            <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="dateend.lable" 
            is-open="dateend.opened" placeholder="截止时间" ng-required="true" 
            close-text="关闭" current-text="今天" clear-text="清除"  readonly/>
            <span class="input-group-btn">
              <button type="button" class="btn btn-default">
                <i class="glyphicon glyphicon-calendar"></i>
              </button>
            </span>
          </div>
		    </div>
		    <a class="btn btn-xs btn-link quick-btn" ng-click="today()">今天</a>
        <a class="btn btn-xs btn-link quick-btn" ng-click="yesterday()">昨天</a>
        <a class="btn btn-xs btn-link quick-btn" ng-click="thisWeek()">本周</a>
        <a class="btn btn-xs btn-link quick-btn" ng-click="lastWeek()">上周</a>
        <a class="btn btn-xs btn-link quick-btn" ng-click="thisMonth()">本月</a>
        <a class="btn btn-xs btn-link quick-btn" ng-click="lastMonth()">上月</a>
	    </div>
      <div class="row col-lg-12 mt10">
		    <label class="form-control-static col-lg-2" style="width: 13%; text-align: right">查询条件：</label>
		    <div class="col-lg-2-4">
		      <input type="text" class="form-control" ng-model="searchform.person" placeholder="收货人姓名/收货人电话">
		    </div>
		    <div class="col-lg-2-4">
				  <ui-select ng-model="searchform.state" theme="bootstrap">
					  <ui-select-match placeholder="发货状态">{{$select.selected.label}}</ui-select-match>
					  <ui-select-choices repeat="item.value as item in state_list">
						  <span ng-bind-html="item.label"></span>
					  </ui-select-choices>
				  </ui-select>
			  </div>
		    <div class="col-lg-3 text-left">
		      <a class="btn btn-xs btn-link under-line" style="color: #428bca; vertical-align:-webkit-baseline-middle" 
		      ng-click="searchform.moreSearch=!searchform.moreSearch">更多搜索 
		        <i class="fa fa-caret-down" ng-show="!searchform.moreSearch"></i>
		        <i class="fa fa-caret-up" ng-show="searchform.moreSearch"></i>
		      </a>
		    </div>
		    <div class="col-lg-2">
		      <button class="btn btn-block btn-info" ng-click="loadData(1)">立即搜索</button> 
		    </div>
	    </div>
      <div ng-show="searchform.moreSearch">
        <div class="row col-lg-12 mt10">
					<label class="form-control-static col-lg-2" style="width: 13%; text-align: right"></label>
					<div class="col-lg-2-4">
						<input type="text" class="form-control" ng-model="searchform.code" placeholder="订单编号">
					</div>
          <div class="col-lg-3">
            <input type="text" class="form-control" ng-model="searchform.title" placeholder="产品名称">
          </div>
		    </div>
      </div>
    </div>
  </div>

	<div class="panel panel-default">
		<div class="panel-body">
			<table class="table table-condensed table-bordered" style="margin-bottom: 5px">
				<thead style="background-color: #eaeff0;">
          <tr>
						<th class="text-center" style="width: 38%">产品信息</th>
						<th class="text-center" style="width: 10%">规格/数量</th>
						<th class="text-center" style="width: 10%">支付方式</th>
						<th class="text-center" style="width: 18%">收货信息</th>
						<th class="text-center" style="width: 10%">状态</th>
						<th class="text-center" style="width: 14%">操作</th>
					</tr>
				</thead>
			</table>
			<div class="panel-group">
				<div class="panel panel-default" ng-repeat="order in order_list">
					<div class="panel-heading">
						<h4 class="panel-title">
							<div class="clear">
							  <span class="label text-md bg-info">{{order.down_company_name}}</span>
								{{order.create_time}}
								<span class="text-muted" style="font-size: 14px;">（订单号：{{order.code}}）</span>
							</div>
						</h4>
					</div>
					<div id={{$index}} class="panel-collapse collapse in">
						<div class="panel-body pad0">
							<div class="pull-left content_style height77 text-left" style="width: 37%">
								<img ng-src="{{order.top_pic}}" width="80" height="70" class="top_pic" ng-if="order.top_pic">
								<strong style="font-size: 17px;">{{order.sale_name}}</strong><br/>
								产品编号：{{order.sale_code}}<br/>
								供应商：{{order.up_company_name}}
							</div>
							<div class="pull-left content_style height77 text-right" style="width: 10%">
								{{order.skuid}}<br/>
								{{order.pay_fee / 100 | currency: '￥'}}<br/>
								x {{order.num}}
							</div>
							<div class="pull-left content_style height77 text-center" style="width: 10%">
								<span ng-show="order.pay_state!='1'"><br/>未支付</span>
								<span ng-show="order.pay_state=='1'">
									支付完成<br/>({{dictdata['pay'+order.payment_type]}})
								</span>
							</div>
							<div class="pull-left content_style height77 text-left" style="width: 18%">
								{{order.mail_name}}<br>
								{{order.mail_mobile}}<br>
								<div title="{{order.mail_address}}" class="overhidden">{{order.mail_address}}</div>
							</div>
							<div class="pull-left content_style height77 text-center" style="width: 10%">
								<br/>{{dictdata['mail'+order.mail_state]}}
							</div>
							<div class="pull-left height77 text-center" style="width: 15%; padding-top: 3px">
								<div ng-show="order.order_is_over==1" class="mt10">交易完成</div>
								<br ng-if="order.order_is_over!=1 && order.supplier=='0'"/>
								<button type="button" class="btn btn-info btn-xs mt1" ng-click="orderinfo(order)">订单详情</button>
								<button type="button" ng-show="order.down_company_name=='商城'" class="btn btn-info btn-xs mt1" ng-click="skv4Profit(order)">分润</button>
								<div ng-show="order.order_is_over!=1 && order.supplier=='1'">
									<button type="button" class="btn btn-info btn-xs mt1" ng-click="setOrderInfo(order,true)"
									ng-show="order.pay_state=='1' && (order.mail_state==0 || order.mail_state==1)">确认发货</button>
									<br ng-show="order.mail_state==0 || order.mail_state==1"/>
									<button type="button" class="btn btn-info btn-xs mt1" ng-click="setOrderInfo(order,true)"
									ng-show="order.mail_state==2">更改快递单</button>
									<button type="button" class="btn btn-info btn-xs mt1" ng-click="gotoKD(order)"
									ng-show="order.mail_state==2">物流查询</button>
									<br ng-show="order.mail_state==2"/>
									<button type="button" class="btn btn-danger btn-xs mt1" ng-click="cancelSend(order)"
									ng-show="order.mail_state==2">取消发货</button>
									<button type="button" class="btn btn-info btn-xs mt1" ng-click="setOrderInfo(order,false)"
									ng-show="order.mail_state==0 || order.mail_state==1">更改收货信息</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="text-right" style="background-color: white">
				<pagination total-items="bigTotalItems" ng-model="bigCurrentPage" max-size="5" rotate="false"
				boundary-links="true" ng-change="loadData(bigCurrentPage)" items-per-page="itemsPerPage" 
				previous-text="上一页" next-text="下一页" first-text="首页" last-text="末页" >
				</pagination>
			</div>
		</div>
	</div>
</div>
